#ifndef NETWORK_CONNECTION_H
#define NETWORK_CONNECTION_H

#include <QObject>


namespace Network {

class ConnectionRequest;

class Connection : public QObject
{
    Q_OBJECT
public:
    explicit Connection(QObject *parent = 0);
    enum Error {
        None,
        InvalidParams
    };

signals:
    void connected();
    void received(QByteArray message);
    void disconnected();

public:
    virtual bool connect(const QString &url, unsigned int port, const QVariant &params) = 0;
    virtual bool post(ConnectionRequest *request) = 0;
    virtual bool isConnected() const = 0;
    virtual bool disconnect() = 0;
};

} // namespace Network
#endif // NETWORK_CONNECTION_H
